﻿using System.Data.Common;
using Abp.EntityFramework;
using System.Data.Entity;
using AVIS.OutBound.Cities;
using AVIS.OutBound.Contents;
using AVIS.OutBound.AWD;
using AVIS.OutBound.Continents;
using AVIS.OutBound.EntityFramework.Models;
using AVIS.OutBound.RateCodes;
using EntityFramework.DynamicFilters;
using Abp.Domain.Uow;
using Abp.Domain.Entities;
using AVIS.OutBound.RentalPolicys;
using AVIS.OutBound.Countrys;
using AVIS.OutBound.Orders;
using AVIS.OutBound.WizardAgent;
using AVIS.OutBound.ORFleets;
using AVIS.OutBound.ThirdOrders;
using AVIS.OutBound.Notify;
using AVIS.OutBound.Stores;
using AVIS.OutBound.FrequentTravellerPartners;
using AVIS.OutBound.OrderPay;

namespace AVIS.OutBound.EntityFramework
{
    public class OutBoundDbContext : AbpDbContext
    {
        //Example:
        //public virtual IDbSet<User> Users { get; set; }
        public virtual IDbSet<City> Cities { get; set; }

        public virtual IDbSet<AWDNumber> AWDs { get; set; }

        public virtual IDbSet<tblBinCode> BinCodes { get; set; }

        public virtual IDbSet<Content> Contens { get; set; }

        public virtual IDbSet<Continent> Continent { get; set; }

        public virtual IDbSet<AvisORRegion> ORRegion { get; set; }

        public virtual IDbSet<AvisORRegionCN> ORRegionCN { get; set; }

        public virtual IDbSet<RateCode> RateCode { get; set; }

        public virtual IDbSet<RentalPolicy> RentalPolicy { get; set; }

        public virtual IDbSet<AvisORLocation> AvisORLocation { get; set; }

        public virtual IDbSet<ORFleet> Fleets { get; set; }

        public virtual IDbSet<AvisStore> AvisStore { get; set; }

        public virtual IDbSet<AvisORLocshr> AvisORLocshr { get; set; }

        public virtual IDbSet<Country> Country { get; set; }

        public virtual IDbSet<avisOBOrder> AvisOBOrder { get; set; }

        public virtual IDbSet<avisOBOrderExt> AvisOBOrderExt { get; set; }

        public virtual IDbSet<FrequentTravellerPartner> AvisORFrequentTravellerpartner { get; set; }

        public virtual IDbSet<YouYouOrder> YouYouOrders { get; set; }

        public virtual IDbSet<AAOrder> AAOrders { get; set; }

        public virtual IDbSet<AvisErrorMessage> AvisErrorMessage { get; set; }

        public virtual IDbSet<AddWizardMonitorLogJobArgs> AvisWizardLogs { get; set; }

        public virtual IDbSet<avisPriceInclude> AvisPriceIncludes { get; set; }

        public virtual IDbSet<tblMasterData> MasterDatas { get; set; }

        public virtual IDbSet<MailInfo> MailInfos { get; set; }

        public virtual IDbSet<SMSInfo> SMSInfos { get; set; }

        public virtual IDbSet<MailType> MailTypes { get; set; }

        public virtual IDbSet<OrderPayLog> OrderPayLog { get; set; }

        public virtual IDbSet<OrderPayTrans> OrderPayTrans { get; set; }

        public virtual IDbSet<PayGatewayLog> PayGatewayLog { get; set; }

        public virtual IDbSet<AvisMember> AvisMember { get; set; }

        /* NOTE: 
         *   Setting "Default" to base class helps us when working migration commands on Package Manager Console.
         *   But it may cause problems when working Migrate.exe of EF. If you will apply migrations on command line, do not
         *   pass connection string name to base classes. ABP works either way.
         */
        public OutBoundDbContext()
            : base("Default")
        {

        }

        /* NOTE:
         *   This constructor is used by ABP to pass connection string defined in OutBoundDataModule.PreInitialize.
         *   Notice that, actually you will not directly create an instance of OutBoundDbContext since ABP automatically handles it.
         */
        public OutBoundDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {

        }

        //This constructor is used in tests
        public OutBoundDbContext(DbConnection existingConnection)
         : base(existingConnection, false)
        {

        }

        public OutBoundDbContext(DbConnection existingConnection, bool contextOwnsConnection)
         : base(existingConnection, contextOwnsConnection)
        {

        }

        public override void Initialize()
        {
            base.Initialize();
            this.SetFilterScopedParameterValue(AbpDataFilters.SoftDelete, true);
        }
    }
}
